<${r"#"}if cardone.StringUtils.isNotBlank(${(businessCode?uncap_first)!''}Id)>
    SELECT T.*
    FROM ${entityMapper.tableName} T
    WHERE T.${EntityMapperUtils.getPKS(entityMapper)!'ID'} = :${(businessCode?uncap_first)!''}Id
<${r"#"}else>
    SELECT T.* FROM (SELECT T.*
    , ROW_NUMBER() OVER(ORDER BY T.ORDER_BY_) RN
    FROM ${entityMapper.tableName} T
    <${r"#"}include "page.where.ftl">) T
    WHERE T.RN BETWEEN (:offset + 1) AND (:offset + :pageSize)
</${r"#"}if>